<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jstl/core"
                xmlns:sf="http://www.springframework.org/tags/faces"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:spring="http://www.springframework.org/tags"
                template="../../../layout/Template.xhtml">

    <ui:define name="menu">
        <ui:include src="${user.menu}"/>
    </ui:define>

    <ui:define name="title">
        <h:outputText value="#{resourceBundle.createPartialWelcome}"/>
    </ui:define>

    <ui:define name="content">

        <ui:fragment id="createPartialFragment">
            <rich:panel id="createPartialPanel" header="#{resourceBundle.createPartialWelcome}">
                <h:form id="createPartialForm">
                    <h:panelGrid id="createPartialGrid" columns="3">
                        <h:outputText
                                value="#{resourceBundle.createPartialFormSubject} : "/>
                        <h:inputText
                                value="#{viewScope.createdPartial.subject}"
                                id="subject" required="true"
                                requiredMessage="#{resourceBundle.createPartialRequiredMessageSubject}"/>
                        <h:message for="subject" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createPartialFormCorrection} : "/>
                        <h:inputTextarea
                                value="#{viewScope.createdPartial.correction}"
                                id="correction"/>
                        <h:message for="correction" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createPartialFormLinkCorrection} : "/>
                        <h:inputText
                                value="#{viewScope.createdPartial.linkCorrection}"
                                id="linkCorrection"/>
                        <h:message for="linkCorrection" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createPartialFormWeight} : "/>
                        <h:inputText
                                value="#{viewScope.createdPartial.weight}"
                                id="weight" required="true"
                                requiredMessage="#{resourceBundle.createPartialRequiredMessageWeight}"/>
                        <h:message for="weight" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createPartialFormStartTime} : "/>
                        <h:inputText
                                value="#{viewScope.createdPartial.startTime}"
                                id="startTime" required="true"
                                requiredMessage="#{resourceBundle.createPartialRequiredMessageStartTime}"
                                converterMessage="#{resourceBundle.createPartialConverterMessageStartTime}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="startTime" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createPartialFormEndTime} : "/>
                        <h:inputText
                                value="#{viewScope.createdPartial.endTime}"
                                id="endTime" required="true"
                                requiredMessage="#{resourceBundle.createPartialRequiredMessageEndTime}"
                                converterMessage="#{resourceBundle.createPartialConverterMessageEndTime}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="endTime" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createPartialFormDate} : "/>
                        <h:inputText
                                value="#{viewScope.createdPartial.date}"
                                id="date" required="true"
                                requiredMessage="#{resourceBundle.createPartialRequiredMessageDate}"
                                converterMessage="#{resourceBundle.createPartialConverterMessageDate}">
                            <f:convertDateTime pattern="dd/MM/yy"
                                               type="date"/>
                        </h:inputText>
                        <h:message for="date" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createPartialFormConsultationHour} : "/>
                        <h:inputText
                                value="#{viewScope.createdPartial.consultationHour}"
                                id="consultationHour"
                                converterMessage="#{resourceBundle.createPartialConverterMessageConsultationHour}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="consultationHour" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createPartialFormConsultationDate} : "/>
                        <h:inputText
                                value="#{viewScope.createdPartial.consultationDate}"
                                id="consultationDate"
                                converterMessage="#{resourceBundle.createPartialConverterMessageConsultationDate}">
                            <f:convertDateTime pattern="dd/MM/yy"
                                               type="date"/>
                        </h:inputText>
                        <h:message for="consultationDate" style="color:red"/>
                    </h:panelGrid>

                    <h:messages globalOnly="true"/>

                    <a4j:commandButton type="submit" value="#{bundle.addButton}" action="add"/>
                    <a4j:commandButton value="#{bundle.cancelButton}" action="cancel" immediate="true"/>
                </h:form>
            </rich:panel>
        </ui:fragment>
    </ui:define>

</ui:composition>